package com.xindacloud.sms.console.system.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xindacloud.sms.console.result.Result;
import com.xindacloud.sms.console.system.dto.SmsUiContentDTO;
import com.xindacloud.sms.console.system.entity.SmsUiContent;
import com.xindacloud.sms.console.system.service.ISmsUiContentService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 * 系统主菜单表 前端控制器
 * </p>
 *
 * @author czc
 * @since 2019-10-08
 */
@Api(tags = {"网站内容模块"})
@RestController
@RequestMapping("/api/v1/sms-ui-content")
public class SmsUiContentController {
	
	@Autowired
	private ISmsUiContentService smsUiContentService;

	@ApiOperation(value = "获取文章列表",response=SmsUiContent.class)
	@PostMapping(value = "/getSmsUiContentList")
	public Result getSmsUiContentList(@RequestBody SmsUiContentDTO smsUiContentDTO) {
	    return smsUiContentService.getSmsUiContentList(smsUiContentDTO);
	}
	
	@ApiOperation(value = "获取文章Tree列表",response=SmsUiContent.class)
	@PostMapping(value = "/getSmsUiContentTreeList")
	public Result getSmsUiContentTreeList(@RequestBody SmsUiContentDTO smsUiContentDTO) {
	    return smsUiContentService.getSmsUiContentTreeList(smsUiContentDTO);
	}
	
	@ApiOperation(value = "保存或修改文章",response=SmsUiContent.class)
	@PostMapping(value = "/saveOrUpdateSmsUiContent")
	public Result saveOrUpdateSmsUiContent(@RequestBody SmsUiContentDTO smsUiContentDTO) {
	    return smsUiContentService.saveOrUpdateSmsUiContent(smsUiContentDTO);
	}
	
	@ApiOperation(value = "删除文章")
	@PostMapping(value = "/deleteSmsUiContent")
	public Result deleteSmsUiContent(@RequestBody SmsUiContentDTO smsUiContentDTO) {
	    return smsUiContentService.deleteSmsUiContent(smsUiContentDTO);
	}

}
